﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Data;


namespace Presentation
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSalvar_Click(object sender, EventArgs e)
        {
            try
            {
                TBTipoFuncionario tipo = new TBTipoFuncionario();
                tipo.descricao = txtDescTipoFuncionario.Text;


                using (DBUCNEntities banco = new DBUCNEntities())
                {
                    banco.AddToTBTipoFuncionarios(tipo);
                    banco.SaveChanges();
                }
                Response.Redirect("TipoFuncionarioConsulta.aspx");

            }
            catch (Exception)
            {
                
              throw;
            }  
             

        }

        protected void btnVoltar_Click(object sender, EventArgs e)
        {
            Response.Redirect("TipoFuncionarioConsulta.aspx");
        }
    }
}